625b2b
@@ -16,9 +16,13 @@
  */
 package org.fusesource.camel.component.sap;
 
+import org.fusesource.camel.component.sap.util.ComponentDestinationDataProvider;
+import org.fusesource.camel.component.sap.util.ComponentServerDataProvider;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 
+import com.sap.conn.jco.ext.Environment;
+
 public class Activator implements BundleActivator {
 
 	private static BundleContext context;
@@ -40,6 +44,10 @@
public class Activator implements BundleActivator {
 	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
 	 */
 	public void stop(BundleContext bundleContext) throws Exception {
+		// Ensure data providers are unregistered s.t. this bundle can be reinstalled.
+		Environment.unregisterDestinationDataProvider(ComponentDestinationDataProvider.INSTANCE);
+		Environment.unregisterServerDataProvider(ComponentServerDataProvider.INSTANCE);
+
 		Activator.context = null;
 	}
 
